/**
 * @file nguser.cpp
 * @author Suk Robert Koh (srkoh87z@gmail.com)
 */

#include "ngine/server/nguser.h"

/**
 * Default constructor for NGUser class
 */
NGUser::NGUser()
{
	// initialize variables
	connected = FALSE;

	socket = INVALID_SOCKET;
	userId = 0;

	trafficTick = 0;
	trafficCount = 0;

	sendQueue = new NGMessageQueue();

	recvBuffer = (char *) malloc(DEFAULT_RECV_BUF_SIZE);
	bufferPosition = 0;
}

/**
 * Destructor for NGUser class
 */
NGUser::~NGUser()
{
	// release recvBuffer
	if(recvBuffer != NULL)
	{
		free(recvBuffer);
	}
}
